package com.webproject.dao.impl.RateManager;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.webproject.core.Page;
import com.webproject.dao.RateManager.RateManagerDao;
import com.webproject.entity.rate.MonthRate;
import com.webproject.entity.rate.WaterElectricityRate;

public class RateManagerDaoImpl extends SqlMapClientDaoSupport implements RateManagerDao{

	@Override
	public List<WaterElectricityRate> queryWaterEle(Page page) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().queryForList("rateManager.queryWaterEle",page);
	}

	@Override
	public int queryWaterEleCount(Page page) {
		// TODO Auto-generated method stub
		return (Integer) getSqlMapClientTemplate().queryForObject("rateManager.queryWaterEleCount", page);
	}

	@Override
	public void saveWaterEle(WaterElectricityRate rate) {
		// TODO Auto-generated method stub
		getSqlMapClientTemplate().insert("rateManager.saveWaterEle", rate);
	}

	@Override
	public void updateWaterEle(WaterElectricityRate rate) {
		// TODO Auto-generated method stub
		getSqlMapClientTemplate().insert("rateManager.updateWaterEle", rate);
	}

	@Override
	public List<MonthRate> queryMonthRate(Page page) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().queryForList("rateManager.queryMonthRate", page);
	}

	@Override
	public int queryMonthRateCount(Page page) {
		// TODO Auto-generated method stub
		return (Integer) getSqlMapClientTemplate().queryForObject("rateManager.queryMonthRateCount", page);
	}

	@Override
	public void saveMonthRate(MonthRate rate) {
		// TODO Auto-generated method stub
		getSqlMapClientTemplate().insert("rateManager.saveMonthRate", rate);
	}

	@Override
	public void updateMonthRate(MonthRate rate) {
		// TODO Auto-generated method stub
		getSqlMapClientTemplate().update("rateManager.updateMonthRate", rate);
	}

	@Override
	public List<WaterElectricityRate> queryWaterEleByCondition(
			MonthRate rate) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().queryForList("rateManager.queryWaterEleByCondition",rate);
	}

	@Override
	public List<WaterElectricityRate> querySavedWaterEle(
			WaterElectricityRate rate) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().queryForList("rateManager.querySavedWaterEle",rate);
	}

}
